package com.zxgj.datadirect.feign;

import com.zxgj.datadirect.entity.req.NationalApplyReq;
import com.zxgj.datadirect.entity.req.NationalApplyStatusReq;
import com.zxgj.datadirect.entity.req.NationalExchangeLogReq;
import com.zxgj.datadirect.entity.resp.NationalApplyResp;
import com.zxgj.datadirect.entity.resp.NationalApplyStatusResp;
import com.zxgj.datadirect.entity.resp.NationalExchangeLogResp;
import com.zxgj.datadirect.entity.resp.NationalResourceResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "national-data-service", url = "${national.data.direct.url}") // 配置国家平台地址
public interface NationalDataDirectFeign {

    /**
     * 获取数据资源增量更新（对应规范“数据目录/资源增量更新接口”）
     * @param token 认证令牌（从配置或登录态获取）
     * @param lastSyncTime 上次同步时间（用于增量筛选）
     * @return 国家平台返回的资源增量响应
     */
    @PostMapping("/sync/getResourceIncrement")
    NationalResourceResp getResourceIncrement(
        @RequestHeader("Authorization") String token,
        @RequestParam("lastSyncTime") String lastSyncTime
    );

    NationalExchangeLogResp getExchangeTaskLogs(String s, NationalExchangeLogReq logReq);

    NationalApplyStatusResp getApplyStatus(String s, NationalApplyStatusReq statusReq);

    NationalApplyResp submitApply(String token, NationalApplyReq nationalReq);

    boolean cancelApply(String nationalPlatformToken, Object nationalApplyNo);

}